package io.renren.utils.util;

import org.apache.log4j.Logger;

/**
 * @author tosmart@gmail.com
 */
public class StringUtil {
	static Logger logger = Logger.getLogger(StringUtil.class.getName());

	/**
	 * Signleton Pattern, only use a static public method of class
	 */
	private StringUtil() {
	}

	/**
	 * To determine whether a string is Null, or contains only empty characters
	 * 
	 * @param str
	 *            String instance
	 * @return true or false
	 */
	public static boolean isEmpty(String str) {
		return (str == null) || (str.trim().length() == 0);

	}

	/**
	 * To determine whether a string is Not Null, or contains Not only empty
	 * characters
	 * 
	 * @param str
	 *            String instance
	 * @return true or false
	 */
	public static boolean notEmpty(String str) {
		return !isEmpty(str);
	}
}